<!-- 继承form.html模板 -->
{% extends "public/form.html" %}
{% block content %}
    <!-- 引入全局自定义组件 -->
    {% load switch select editor submit %}
    <form class="layui-form model-form" action="" style="width: 80%;">
        <input name="id" id="id" type="hidden" value="{{data.id}}">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">通知标题：</label>
                <div class="layui-input-inline">
                    <input name="title" value="{{data.title}}" lay-verify="required" autocomplete="off" placeholder="请输入通知标题" class="layui-input" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">通知来源：</label>
                <div class="layui-input-inline">
                    {% select "source|1|通知来源|name|id" sourceList data.source %}
                </div>
            </div>
        </div>
         <div class="layui-form-item">

        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">外部链接：</label>
                <div class="layui-input-inline">
                    <input name="url" value="{{data.url}}" lay-verify="required" autocomplete="off" placeholder="请输入外部链接" class="layui-input" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">点击率：</label>
                <div class="layui-input-inline">
                    <input name="click" value="{{data.click}}" lay-verify="required|number" autocomplete="off" placeholder="请输入点击率" class="layui-input" type="text">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">是否置顶：</label>
                <div class="layui-input-inline">
                     {% switch "is_top" "已置顶|未置顶" data.is_top|default:1 %}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">通知状态：</label>
                <div class="layui-input-inline">
                    {% switch "status" "已发布|未发布" data.status|default:1 %}
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">通知内容：</label>
            <div class="layui-input-block">
                <textarea name="content" id="content" lay-verify="required" class="layui-textarea">{{data.content}}</textarea>
                {% editor "content" "default" "80%" 450 %}
            </div>
        </div>
        {% submit "submit|立即保存,close|关闭" 1 "" %}
    </form>
{% endblock %}